package cn.com.connext.scrm.domain.master;

import cn.com.connext.scrm.service.dto.ValidDate;
import com.connext.common.domain.UUIDDomain;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
import java.util.Objects;

@Entity
@Table(name = "crm_coupon")
public class CrmCoupon implements UUIDDomain,Serializable {
    private static final long serialVersionUID = 8374691479507725131L;
    @Id
    private String id;//优惠券id

    @Column(name = "coupon_name")
    private String couponName;//优惠券名称

    @Column(name = "coupon_type")
    private String couponType;//优惠券类型 1为代金券，2为折扣券，3为商品券

    @Column(name = "draw_limit")
    private String drawLimit;//每人限令张数

    @Column(name = "total")
    private Integer total;//总张数

    @Column(name = "store")
    private Integer store;//库存

    @Column(name = "note")
    private String note;//使用须知

    @Column(name = "valid_type")
    private  Integer validType;//1为绝对日期范围，2为相对领取时间

    @Column(name = "start_date")
    private Date startDate;

    @Column(name = "end_date")
    private Date endDate;

    @Column(name = "start_days")
    private Integer startDays;

    @Column(name = "valid_days")
    private Integer validDays;

    @Override
    public String getId() {
        return id;
    }

    @Override
    public void setId(String id) {
        this.id = id;
    }

    public String getCouponName() {
        return couponName;
    }

    public void setCouponName(String couponName) {
        this.couponName = couponName;
    }

    public String getCouponType() {
        return couponType;
    }

    public void setCouponType(String couponType) {
        this.couponType = couponType;
    }

    public String getDrawLimit() {
        return drawLimit;
    }

    public void setDrawLimit(String drawLimit) {
        this.drawLimit = drawLimit;
    }

    public Integer getTotal() {
        return total;
    }

    public void setTotal(Integer total) {
        this.total = total;
    }

    public Integer getStore() {
        return store;
    }

    public void setStore(Integer store) {
        this.store = store;
    }

    public String getNote() {
        return note;
    }

    public void setNote(String note) {
        this.note = note;
    }

    public Date getStartDate() {
        return startDate;
    }

    public void setStartDate(Date startDate) {
        this.startDate = startDate;
    }

    public Date getEndDate() {
        return endDate;
    }

    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }

    public Integer getValidType() {
        return validType;
    }

    public void setValidType(Integer validType) {
        this.validType = validType;
    }

    public Integer getStartDays() {
        return startDays;
    }

    public void setStartDays(Integer startDays) {
        this.startDays = startDays;
    }

    public Integer getValidDays() {
        return validDays;
    }

    public void setValidDays(Integer validDays) {
        this.validDays = validDays;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        CrmCoupon coupon = (CrmCoupon) o;
        return Objects.equals(id, coupon.id);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id);
    }
}
